// const Promise = require("../promise.js");
const fs = require("fs/promises"); // 
const path = require("path");
const readFile = (url) =>{
    return new Promise((resolve,reject)=>{
        fs.readFile(url,"utf8",(err,data)=>{
            if(err){
                return reject(err);
            }
              resolve(data);
        })
    }) 
}
const d1  = Promise.all([readFile(path.resolve(__dirname,"./age.txt")),readFile(path.resolve(__dirname,"./name.txt"))])
d1.then(res=>{console.log('res',res)})
// console.log('%c [  ]-17', 'font-size:13px; background:pink; color:#bf2c9f;', d1)
// const getAge = async(url)=>{
//     const age =   await readFile(url)
//     console.log('age',age);
// } 
// getAge(path.resolve(__dirname,"./age.txt"));

// const age  =   readFile(path.resolve(__dirname,"./age.txt")).then(res=>{
//     console.log('res',res)
// })